-- GENERATED SPELL FOR [Chaos Gazer] --


function spell0_25595(pUnit, Event) --@Drain Life,Drain--
pUnit:FullCastSpellOnTarget(46291,pUnit:GetRandomPlayer(0))
pUnit:RegisterEvent('Sorts_25595', 10000, 1)
end

function spell1_25595(pUnit, Event) --@Petrify,n/a--
pUnit:FullCastSpellOnTarget(46288,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_25595', 9500, 1)
end

function spell2_25595(pUnit, Event) --@Tentacle Sweep,n/a--
pUnit:FullCastSpellOnTarget(46290,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_25595', 566, 1)
end

function Sorts_25595(pUnit, Event)
local choix_sorts_25595 = math.random(0, 2)
if choix_sorts_25595 == 0 then
pUnit:RegisterEvent('spell0_25595', 1, 1)
end
if choix_sorts_25595 == 1 then
pUnit:RegisterEvent('spell1_25595', 1, 1)
end
if choix_sorts_25595 == 2 then
pUnit:RegisterEvent('spell2_25595', 1, 1)
end
end

function mob25595_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_25595', math.random(1500, 3000), 1)
end

function mob25595_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob25595_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob25595_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(25595, 1, 'mob25595_Action')
RegisterUnitEvent(25595, 2, 'mob25595_Leave')
RegisterUnitEvent(25595, 3, 'mob25595_Kill')
RegisterUnitEvent(25595, 4, 'mob25595_Die')
